<?php

class Point_goodsController extends Controller
{
    public function listAction() {
        $page = intval(Request::get('page', 1));
        $pageSize = intval(Request::get('pageSize', 20));
        $where = $value = $order = [];
        $where[] = 'status=1';
        Response::ajax(200, 'success', self::model('point_goods')->getList(
                $where, $value, $order, $page, $pageSize
        ));
    }
    
    public function infoAction() {
        $pointGoodsId = intval(Request::get('pointGoodsId'));
        if(!$pointGoodsId||!$pointGoodsInfo = self::model('point_goods')->findById($pointGoodsId)) {
            Response::ajax(NORMAL_ERROR, '信息获取失败');
        }
        Response::ajax(200, 'success', $pointGoodsInfo);
    }
    
}